import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home/Home.vue'
import mallChildRoute from './modules/mallRoute';
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/login',
    name: 'Login',
    component: function () {
      return import('../views/Login.vue')
    }
  },
  {
    path: '/register',
    name: 'Register',
    component: function () {
      return import('../views/Register.vue')
    }
  },
  { // 产品商城
    path: '/mall',
    component: function () {
      return import('../views/Mall/index.vue')
    },
    children: mallChildRoute
  },
  { // 发布中心
    path: '/release',
    name: 'Release',
    component: function () {
      return import('../views/Release/index.vue')
    }
  },
  {
    path: '/consult',
    name: 'Consult',
    component: function () {
      return import('@/views/Consult/index.vue')
    },
  },
  {
    path: '/consultDetail',
    name: 'ConsultDetail',
    component: function () {
      return import('../views/Consult/consultDetail.vue')
    }
  },
  
  {
    path: '/help',
    name: 'Help',
    component: function () {
      return import('../views/Help/index.vue')
    }
  },
  { // 个人中心
    path: '/individual',
    name: 'Individual',
    component: function () {
      return import('../views/Individual/index.vue')
    }
  },
  
]

const router = new VueRouter({
  routes,
  })

export default router
